# Replication code for IO article "The role of Pan-African ideology in ethnic power-sharing"
# Authors: 
#	Janina Beiser-McGrath (Janina.Beiser-McGrath@rhul.ac.uk)
#	Sam Erkiletian (samuel.erkiletian.16@ucl.ac.uk) 
#	Nils W. Metternich (n.metternich@ucl.ac.uk)

# Code replicates all Figures and Tables in the article and its online appendix
# Figures will be saved in specified "pathOUT"
# Tables will be displayed in R console
# R version: 4.3.1 
# OS: MacOS 14.4.1


# Please refer to the codebook for variable description
# Please notify the authors if you become aware of any issues with the code
# Please use the following citation if using the Pan-African conference information:

	#Janina Beiser-McGrath, Sam Erkiletian, and Nils W. Metternich
	#2024
	#The role of Pan-African ideology in ethnic power-sharing
	#International Organization
	#Forthcoming
	


rm(list = ls())

library(PanelMatch)
library(tidyr)
library(zoo)
library(plm)
library(texreg)
library(ggplot2)
library(dplyr)


#Please update your username ("YOURUSERNAME") and paths ("YOURPATH") to the location of replication data and code. 

if(
  Sys.info()["user"]=="YOURUSERNAME"){pathData="YOURPATH";pathR="YOURPATH";pathOUT="YOURPATH"}

#Example:
if(
  Sys.info()["user"]=="nils"){pathData="~/Dropbox/elements/Panafricanism project/Data/Rcode/IO_replication";pathR="~/Dropbox/elements/Panafricanism project/Data/Rcode/IO_replication";pathOUT="~/Desktop"}
  

setwd(pathR)  
	source('ingester_1.R')

setwd(pathR) 
	source('table_2.R')

setwd(pathR) 
	source('figure_3.R')

setwd(pathR) 
	source('figure_5.R')

setwd(pathR) 
	source('table_A2.R')

setwd(pathR) 
	source('table_A1.R')

setwd(pathR) 
	source('table_3.R')
	
setwd(pathR) 
	source('figure_2.R')

setwd(pathR)  
	source('ingester_2.R')
				
setwd(pathR)  
	source('figure_A1.R')

setwd(pathR)  
	source('table_4.R')

setwd(pathR)  
	source('figure_4.R')
                          






 






